<template>
<div class="header-content">
    <div class="logo">拾光轨迹</div>
    <div class="search-bar" @click="goToSearch">
        <div class="search-button">
            <span class="search-icon">🔍</span>
            <span class="search-placeholder">搜索你感兴趣的内容...</span>
        </div>
    </div>
    <div class="nav-icons">
        <router-link to="/Index/Profile">
            <div class="nav-icon">👤</div>
        </router-link>
        <a href="#" class="nav-icon">💬</a>
    </div>
</div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

const goToSearch = () => {
    router.push('/Search')
}
</script>

<style lang="scss" scoped>
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.logo {
    font-size: max(18px, min(24px, 2vw));
    font-weight: bold;
    color: #ff6b6b;
    white-space: nowrap; // 文字不换行
}
.search-bar {
    flex: 1;
    max-width: 400px;
    min-width: 110px;
    margin: 0 10px;
    position: relative;
}
.search-button {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    background: #f5f5f5;
    font-size: 13px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.search-icon {
    margin-right: 8px;
    font-size: 14px;
}

.search-placeholder {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-icons {
    display: flex;
    gap: 20px;
}
.nav-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    text-decoration: none;
    color: #666;
    font-size: 20px;
}
</style>